package com.org.cbs.code;

import java.io.IOException;
import java.lang.annotation.Annotation;
import java.util.Locale;
import java.util.Map;

import org.springframework.beans.BeansException;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.MessageSourceResolvable;
import org.springframework.context.NoSuchMessageException;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.ResolvableType;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

/**
 * @ClassName SourcesCodeToString
 * @Description TODO
 * @Author zhengguohui
 * @Date 2018/7/3 11:00
 */
public class SpringCode {

	public static void main(String[] args) {

		// 如果Resource 路径增加classpath 会提示找不到配置文件
		// BeanFactory factory = new XmlBeanFactory(new
		// ClassPathResource("spring.xml"));
		// DemoBean demo1 = (DemoBean)
		// factory.getBean("com.org.cbs.code.DemoBean#0");
		ApplicationContext context = new ClassPathXmlApplicationContext("classpath:spring.xml");
		// String[] sdsf = context.getBeanDefinitionNames();
		DemoBean demo = (DemoBean) context.getBean("demoBean");
		System.out.println(demo.getArrayLists().get(0));
		System.out.println(demo.getSets());
		System.out.println(demo.getMap().get("1111"));

		// BeanWrapperImpl

		// AbstractBeanDefinition
		// XmlBeanDefinitionReader
		// Document
		// BeanDefinition
		// BeanDefinitionRegistry
		// GenericBeanDefinition
	}

}
